package com.ffyc.cms.service;

import com.ffyc.cms.dao.AdvertisingDao;
import com.ffyc.cms.dao.NewstypeDao;
import com.ffyc.cms.model.Advertising;
import com.ffyc.cms.model.Newstype;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class NewstypeService {
    @Autowired
    NewstypeDao newstypeDao;
    public List<Newstype> getnewtpyeList() {
        return newstypeDao.getnewtpyeList();
    }

    public void deletenewtpye(Integer id) {
        newstypeDao.deletenewtpye(id);
    }

    public boolean checkName(String journame) {
        return newstypeDao.checkName(journame)!=0;
    }

    public void savenewstype(Newstype newstype) {
        newstypeDao.savenewstype(newstype);
    }

    public Newstype getnewstypeById(Integer id) {
        return newstypeDao.getnewstypeById(id);
    }

    public void updateNewsType(Newstype newstype) {
        newstypeDao.updateNewsType(newstype);
    }
}
